package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {

    /*
    * 根据openId查询用户
    * */
    @Select("select * from user where openid = #{openId}")
    User getByOpenId(String openId);

    /*
    * 插入数据
    * */
    void insert(User user);

    /*
    * 根据用户id查询
    * */
    @Select("select * from user where id = #{userId}")
    User getById(Long userId);

    /*
    *查询关于时间的用户量
    * */
    Integer countByMap(Map map);
}
